<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/common.jspf"%>
<%@ include file="/common/taglibs.jspf"%>
<html lang="en">
  <head></head>
  <body>
 	
		<!-- toolbar -->
		<div class="toolbar">
      	  <button type="button" class="btn btn-primary" onclick="javascript:location.href='add.do'">
        	<i class="icon-plus icon-white"></i> <s:message code="btn.add" /></button>
          <button type="button" class="btn btn-danger" onclick="javascript:return batchDelete();">
        	<i class="icon-trash icon-white"></i> <s:message code="btn.delete" /></button>       	
		</div>	
		<!-- datatable -->
		<div>			
		  <c:forEach items="${userPortlets }" var="row">
            <div class="portfolio" style="display: inline-block; opacity: 1;">
             <div class="portfolio-wrapper">
                <a href="#"><img src="${contextPath }/static/modules/${row.portletUid }-thumb.png"></a>
                <div class="portfolio-content">                
                    <h2>${row.name }</h2>
                    <p>${row.descr }</p>
                    <button type="button" class="btn btn-edit" ng-click="rowEdit('${row.id }');"><s:message code="btn.config"/></button>&nbsp;
                    <button type="button" class="btn btn-delete" ng-click="rowDelete('${row.id }');"><s:message code="btn.delete"/></button>
                </div>
              </div>
            </div>      
          </c:forEach>        
		</div> 
 	<!--page specific plugin scripts-->	  			
		<script type="text/javascript">
		function rowDelete(id)
		{			
			bootbox.confirm("<s:message code='common.delete.confirm' />", function(result){
				if(result)
				{
					$.webtools.ajax({
						url: "delete.json",
						params: {"id":id},
						success: function(reply) {
							location.reload();
						}
					});					
				}				
			});			
		}		
		
		</script>
  </body>
</html>
